import 'package:flutter/material.dart';

class ButtonItem extends StatelessWidget {
  const ButtonItem(
      {super.key,
      required this.iconData,
      required this.title,
      required this.onTap,
      this.rWidget});
  final IconData iconData;
  final String title;
  final Function onTap;
  final Widget? rWidget;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        onTap();
      },
      child: Container(
        decoration: BoxDecoration(
          border: Border(
            bottom: BorderSide(
                color: Theme.of(context).textTheme.bodyMedium!.color!,
                width: 0.1), // 下边框样式
          ),
        ),
        height: 65,
        padding: const EdgeInsets.only(left: 30, right: 30),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Row(
              children: [
                Icon(
                  iconData,
                  size: 40,
                ),
                const SizedBox(width: 10),
                Text(
                  title,
                  style: const TextStyle(fontSize: 20),
                )
              ],
            ),
            rWidget ?? const Icon(
              Icons.arrow_forward_ios,
            ),
          ],
        ),
      ),
    );
  }
}
